#!/usr/bin/expect

spawn /usr/bin/ssh info@[lindex $argv 0]
expect "*Password:*"
send "info82266558\r"
expect "*info$"
send "mkdir .ssh\r"
send "echo ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA1+xSHLOl+lOkR7Zvfi1+dYYU8fXZEnok4KExE5/5KkQKOWpsvL3KIpcs3R7kyrarXpXbwcgUdfiXGX4Zmr0qw3B9PKfPK5n/FHzj2IrHTC7psq50djWfDn56qsLmGzh+kB+7bMc6oPo5PG1O46H1dRLUFod/gYo5y8yBj8cM30SQf+9TmyUsUGxg9QShrFIzbzvUcza+oXnARMrLiDpjsSLPYfIa37HC5qdkiKbMHEJSZyifVoPwO6QIMw7+P1nU1mu5iP04OdcaJPcbBfKwxTpeafDOPJB7cEb8PQYlsSa0x+ttq8hwqCuIPgs4qkjFLwz5BVCfEAi2A4aXnXewJQ== luyanfei@think >> .ssh/authorized_keys\r"
send "chmod og-rwx .ssh/authorized_keys\r"
send "exit\r"
expect eof
